<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
<script>

let p1 = new Promise((resolve,reject)=>{
    // resolve(123);
    reject(456);
})
p1.then(
    (res)=>{
        console.log( 'p1成功',res );
        // 返回一个进行中状态的Promise对象，终止then链式调用
        return new Promise(()=>{});
    },
    (err)=>{
        console.log( 'p1失败',err );
        // 返回一个进行中状态的Promise对象，终止then链式调用
        return new Promise(()=>{});
    }
)// p2 -> Promise {<pending>:undefined}
.then(
    (res)=>{
        console.log( 'p2成功',res );
    },
    (err)=>{
        console.log( 'p2失败',err );
    }
)

</script>
</body>
</html>